package net.brucecooper.mindmap.client;

import java.util.List;

import com.google.gwt.xml.client.Document;

public interface NodeDataStore {
    public static final int ROOT_NODE = 0;
    
    public NodeOrientation getRootNodeOrientation();
    public void setRootNodeOrientation(NodeOrientation orientation);
    
    public String getNodeForeground(int id);
    public void setNodeForeground(int id, String rgb);
    public String getNodeBackground(int id);
    public void setNodeBackground(int id, String rgb);

    public String getNodeName(int id);
    public String getNodeIcon(int id);
    public List<Integer> getNodeChildren(int id);
    public List<String> getVotesUp(int nodeID);
    public List<String> getVotesDown(int nodeID);
    public NodeOutlineStyle getNodeOutline(int nodeID);
    public void setNodeOutline(int nodeID, NodeOutlineStyle style);
    public boolean isNodeCollapsedInitially(int nodeID);

    public void setNodeName(int theNode, String newName);
    public int addChildTo(int parent);
    public void removeNodeFrom(int parentNode, int id);
    public void setIcon(int nodeID, String newIcon);
    public void changeNodeParent(int nodeID, int oldParent, int newParent);
    public void voteForNode(int nodeID, String username, boolean voteUp);
    public void setNodeCollapsedInitially(int nodeID, boolean collapsed);

    
    public void addNodeDataStoreListener(NodeDataStoreListener l);
    public void removeNodeDataStoreListener(NodeDataStoreListener l);
    public String encodeModel();
	public void replaceModel(Document doc);
	
	public boolean isReady();
}
